﻿@model  PaggingResultModel<RoleInfo, UserRoleSearchModel>
<div class="box">
    <!-- Box Head -->
    <div class="box-head">
        <h2>
            现有用户组</h2>
    </div>
    <!-- End Box Head -->
    <!-- Table -->
    <div class="table">
        <!-- Pagging -->
        <!-- End Pagging -->
        @if (Model.TotalPageCount != 0)
        {
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <th width="13">
                        <input type="checkbox" class="checkbox" onclick="CheckAll(this,'RoleID')"/>
                    </th>
                    <th>
                        用户组名字
                    </th>
                    <th width="110" class="ac">
                        编辑/删除
                    </th>
                </tr>
                @foreach (var role in Model.ResultList)
                {
                    <tr>
                        <td>
                            @Html.CheckBox("RoleID",false,new {@class="checkbox" ,value=@role.ID})
                         
                        </td>
                        <td>
                            <h3>
                                <a href="#">@role.Name</a></h3>
                        </td>
                        <td>
                            <a href="@Url.Action("UserRoleDelete","User",new {ID=@role.ID})" class="ico del">删除</a>
                            <a href="@Url.Action("UserRoleDetail", "User", new { ID = @role.ID })" class="ico edit">编辑</a>
                        </td>
                    </tr>
                }
            </table>
        }
        else
        {
            <div class="empty">
                没有记录</div>
        }
        <!-- Pagging -->
        <div class="pagging">
            @Html.BuildViewCount(Model)
            @Html.BuildPaggingFooter(Model, "User", "UserRoleList")
        </div>
        <!-- End Pagging -->
    </div>
    <!-- Table -->
</div>
@section SideBar{
    <!-- Box -->
    <div class="box">
    <!-- Box Head -->
    <div class="box-head">
        <h2>
            用户权限管理</h2>
    </div>
    <!-- End Box Head-->
    <div class="box-content">
    <a href="@Url.Action("UserRoleCreate", "User")" class="add-button"><span>添加新用户组</span></a>
    <div class="cl">
        &nbsp;</div>
    <!-- inqury -->
    <div class="sort">
        @{ Html.BeginForm("UserRoleList", "User", FormMethod.Get, new { id = "searchRoleForm" }); }
        <table class="tableForForm">
            <tr>
                <td colspan="2">
                    <h4>查找条件</h4>
                </td>
            </tr>
            <tr>
                <td align="right">
                    用户名组：
                </td>
                <td>
                    @Html.TextBox("RoleName", null, new { @class = "field size3" })
                </td>
            </tr>
            <tr>
                <td colspan="2" align="right">
                    <a href="#" onclick="$('#searchRoleForm').submit();" class="submit-button"><span>查询</span></a>
                </td>
            </tr>
        </table>
       @{Html.EndForm();}
            </div>
            <!-- End inqury -->
        </div>
    </div>
    <!-- End Box -->
}
